package testes_funcionais;

import static org.junit.Assert.assertEquals;

import java.sql.SQLException;
import java.util.ArrayList;

import model.Pizza;

import org.junit.Test;

import dao.PizzaDAO;

public class TestPizzaDAO {
	
	PizzaDAO pizzaDAO = new PizzaDAO();
	
	//@Test
	public void listarPizzasTest() throws SQLException {
		
		ArrayList<Pizza> cardapio = new ArrayList<>();
		
		cardapio.addAll(pizzaDAO.listarPizzas());
		
		int quantidadePizzas = cardapio.size();
		
		assertEquals(52, quantidadePizzas);
	}
	
	@Test
	public void recuperarPizzaTest() throws SQLException {
		
		String nomePizza = "Calabresa";
		
		Pizza pizza = pizzaDAO.recuperarPizza(nomePizza);
		
		int codigoPizza = pizza.getCod_pizza();
		
		assertEquals(10, codigoPizza);
		
	}

}
